import request from '@/utils/request'

// 封装面经列表
export const articlelistAPI = ({ current, sorter }) => {
  return request.get('/h5/interview/query', {
    params: {
      current: current, // 当前页
      pageSize: 10, // 每页十条数据
      sorter: sorter // weight_desc表示获取推荐数据 || null表示获取最新数据
    }
  })
}

// 封装页面详情,需要知道哪个详情页，所以传参id
export const getarticleDetailAPI = (id) => {
  return request.get('/h5/interview/show', { params: { id: id } })
}

// 封装点赞和收藏的操作
export const updateLikeAndCollect = ({ id, optType }) => {
  return request.post('/h5/interview/opt', { id, optType })
}

// 封装收藏页
export const collectAPI = (params) => {
  return request.get('/h5/interview/opt/list', { params })
}
